﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace MT.Rest.Core.Models.UserCenter
{
    public class UserAddRequest
    {

        [Required(ErrorMessage = "姓名不能为空")]
        public string Name { get; set; }
        [Required(ErrorMessage = "用户名不能为空")]
        public string UserName { get; set; }
        [Required(ErrorMessage = "手机号码不能为空")]
        public string PhoneNumber { get; set; }

        public string Email { get; set; }

        public string Note { get; set; }

        public string SexDic { get; set; }

        // public Nullable<int> EthnicDictionaryId { get; set; }

        public Nullable<System.DateTime> Birthday { get; set; }

        public string CardId { get; set; }

        public string CardTypeDic { get; set; }

        public string PasswordHash { get; set; }

        //  public int PasswordSalt { get; set; }
        //public string SourceClientTytpeDic { get; set; }

        /// <summary>
        /// 民族
        /// </summary>
        public string NationDic { get; set; }


        /// <summary>
        /// 机构
        /// </summary>
        public List<int> InstitutionIds { get; set; }
        public string ExpireTypeDic { get; set; }

        public Nullable<System.DateTime> ExpireTime { get; set; }

        public string ClientTypeDic { get; set; }


        public string AuthRoleTypeDic { get; set; }
        public List<UserExtendRequest> UserExtendRequest { get; set; }
    }

    public class UserExtendRequest
    {
        /// <summary>
        /// 机构
        /// </summary>
        [Required(ErrorMessage = "请选择机构")]
        public int InstitutionId { get; set; }
        /// <summary>
        /// 角色类型
        /// </summary>
        // [Required(ErrorMessage = "请选择角色类型")]
        // public int BusinessRoleId { get; set; }

        [Required(ErrorMessage = "请选择角色")]
        public List<int> RoleIds{ get; set; }
        [Required(ErrorMessage = "请选择业务角色")]
        public List<string> BusinessRoleDics { get; set; }
    }

    public class UserEditRequest
    {
        public int Id { get; set; }
        // public string SourceClientTytpeDic { get; set; }
        [Required(ErrorMessage = "姓名不能为空")]
        public string Name { get; set; }
        [Required(ErrorMessage = "用户名不能为空")]
        public string UserName { get; set; }
        [Required(ErrorMessage = "手机号码不能为空")]
        public string PhoneNumber { get; set; }
        public string Email { get; set; }

        public string Note { get; set; }

        public string SexDic { get; set; }

        public List<int> InstitutionIds { get; set; }

        public Nullable<System.DateTime> Birthday { get; set; }

        public string CardId { get; set; }

        public string CardTypeDic { get; set; }

       // public string PasswordHash { get; set; }

        // public int PasswordSalt { get; set; }

        // public byte SourceClient { get; set; }

        public string NationDic { get; set; }



        public string AuthRoleTypeDic { get; set; }

        public string ExpireTypeDic { get; set; }

        public Nullable<System.DateTime> ExpireTime { get; set; }

        public string ClientTypeDic { get; set; }
        ///// <summary>
        ///// 姓名
        ///// </summary>
        //[Required(ErrorMessage = "姓名不能为空")]
        //public string Name { get; set; }
        ///// <summary>
        ///// 用户名
        ///// </summary>
        //[Required(ErrorMessage = "用户名不能为空")]
        //public string UserName { get; set; }
        ///// <summary>
        ///// 手机号码
        ///// </summary>
        //[Required(ErrorMessage = "手机号码不能为空")]
        //public string PhoneNumber { get; set; }

        //public string Email { get; set; }

        ///// <summary>
        ///// 验证时间
        ///// </summary>
        //public Nullable<System.DateTime> ValidTime { get; set; }

        ///// <summary>
        ///// 注释
        ///// </summary>
        //public string Note { get; set; }

        //public ActiveStateEnum ActiveState { get; set; }

        //public string SexDic { get; set; }

        //public Nullable<int> EthnicDictionaryId { get; set; }

        //public Nullable<System.DateTime> Birthday { get; set; }
        ///// <summary>
        ///// 身份证id
        ///// </summary>
        //public string CardId { get; set; }
        //public string CardTypeDic { get; set; }
        ///// <summary>
        ///// 来源客户端类型
        ///// </summary>
        //public byte SourceClient { get; set; } = 0;

        //[Required(ErrorMessage = "请选择授权角色类型")]
        //public string AuthRoleTypeDic { get; set; }

        public List<UserExtendRequest> UserExtendRequest { get; set; }
    }

    public class UpdatePwdRequest
    {
        [Required(ErrorMessage = "请输入验证码")]
        public string Code { get; set; }
        [Required(ErrorMessage = "请输入密码")]
        [StringLength(32, MinimumLength = 6)]
        public string Password { get; set; }
        //[DataType(DataType.Password)]
        //[Display(Name = "确认密码")]
        //[System.ComponentModel.DataAnnotations.Compare("Password",ErrorMessage ="两次密码输入不一致")]
        //public string ConfirmPassword { get; set; }
        [Required(ErrorMessage = "请输入手机号码")]
        public string PhoneNumber { get; set; }

    }

    public class RetrievePwdRequest
    {
        [Required(ErrorMessage = "请输入验证码")]
        public string Code { get; set; }
        [Required(ErrorMessage = "请输入密码")]
        [StringLength(32, MinimumLength = 6)]
        public string Password { get; set; }
        //[DataType(DataType.Password)]
        //[Display(Name = "确认密码")]
        //[System.ComponentModel.DataAnnotations.Compare("Password", ErrorMessage = "两次密码输入不一致")]
        //public string ConfirmPassword { get; set; }
        [Required(ErrorMessage = "请输入电话号码")]
        public string PhoneNumber { get; set; }
    }
}
